package me.mcx.mcx.service.impl;

import java.util.List;
import me.mcx.common.utils.DateUtils;
import me.mcx.mcx.domain.McxMessage;
import me.mcx.mcx.mapper.McxMessageMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import me.mcx.mcx.service.IMcxMessageService;

/**
 * 消息信息Service业务层处理
 * 
 * @author mcx
 * @date 2024-09-22
 */
@Service
public class McxMessageServiceImpl implements IMcxMessageService 
{
    @Autowired
    private McxMessageMapper mcxMessageMapper;

    /**
     * 查询消息信息
     * 
     * @param id 消息信息主键
     * @return 消息信息
     */
    @Override
    public McxMessage selectMcxMessageById(Long id)
    {
        return mcxMessageMapper.selectMcxMessageById(id);
    }

    /**
     * 查询消息信息列表
     * 
     * @param mcxMessage 消息信息
     * @return 消息信息
     */
    @Override
    public List<McxMessage> selectMcxMessageList(McxMessage mcxMessage)
    {
        return mcxMessageMapper.selectMcxMessageList(mcxMessage);
    }

    /**
     * 新增消息信息
     * 
     * @param mcxMessage 消息信息
     * @return 结果
     */
    @Override
    public int insertMcxMessage(McxMessage mcxMessage)
    {
        mcxMessage.setCreateTime(DateUtils.getNowDate());
        return mcxMessageMapper.insertMcxMessage(mcxMessage);
    }

    /**
     * 修改消息信息
     * 
     * @param mcxMessage 消息信息
     * @return 结果
     */
    @Override
    public int updateMcxMessage(McxMessage mcxMessage)
    {
        mcxMessage.setUpdateTime(DateUtils.getNowDate());
        return mcxMessageMapper.updateMcxMessage(mcxMessage);
    }

    /**
     * 批量删除消息信息
     * 
     * @param ids 需要删除的消息信息主键
     * @return 结果
     */
    @Override
    public int deleteMcxMessageByIds(Long[] ids)
    {
        return mcxMessageMapper.deleteMcxMessageByIds(ids);
    }

    /**
     * 删除消息信息信息
     * 
     * @param id 消息信息主键
     * @return 结果
     */
    @Override
    public int deleteMcxMessageById(Long id)
    {
        return mcxMessageMapper.deleteMcxMessageById(id);
    }
}
